<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibTools: H:/project/LibTools/src/tools/cpptools/StlImp.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibTools
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.16 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','搜索');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_1563a38af0d3a5e4a6330d6d45e9792a.html">tools</a></li><li class="navelem"><a class="el" href="dir_03ac758817843737b5fab9a7952176a3.html">cpptools</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">StlImp.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_stl_imp_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef __STLIMP_H__</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define __STLIMP_H__</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &quot;../tools.h&quot;</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;utility&gt;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<a class="code" href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160; </div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;</div>
<div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="class_stl_imp.html">   12</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_stl_imp.html">StlImp</a></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;{</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00015"></a><span class="lineno"><a class="line" href="class_stl_imp.html#a99112fb8b06920ed36adf52797c24ce8">   15</a></span>&#160;    <a class="code" href="class_stl_imp.html#a99112fb8b06920ed36adf52797c24ce8">StlImp</a>() :<a class="code" href="class_stl_imp.html#a17f2d5ab8c2e7fd5cc316d2227ca4e4d">_imp</a>(new T()) {}</div>
<div class="line"><a name="l00016"></a><span class="lineno"><a class="line" href="class_stl_imp.html#aa3c54c975efac41dc7b1bedb67701406">   16</a></span>&#160;    <a class="code" href="class_stl_imp.html#aa3c54c975efac41dc7b1bedb67701406">~StlImp</a>() { <span class="keyword">delete</span> <a class="code" href="class_stl_imp.html#a17f2d5ab8c2e7fd5cc316d2227ca4e4d">_imp</a>; <a class="code" href="class_stl_imp.html#a17f2d5ab8c2e7fd5cc316d2227ca4e4d">_imp</a> = <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>; }</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160; </div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#ifdef STD11</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;    <a class="code" href="class_stl_imp.html#a99112fb8b06920ed36adf52797c24ce8">StlImp</a>(<a class="code" href="class_stl_imp.html">StlImp</a>&amp;&amp; imp) : <a class="code" href="class_stl_imp.html#a17f2d5ab8c2e7fd5cc316d2227ca4e4d">_imp</a>(new T()) {</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;        *<span class="keyword">this</span> = std::move(imp);</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    }</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    <a class="code" href="class_stl_imp.html">StlImp</a>&amp; <a class="code" href="class_stl_imp.html#a25f5d9385f2bb6be32d594c643288a86">operator= </a>(<a class="code" href="class_stl_imp.html">StlImp</a>&amp;&amp; imp) {</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;        <span class="keywordflow">if</span> (<span class="keyword">this</span> != &amp;imp) {</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;            *<a class="code" href="class_stl_imp.html#a17f2d5ab8c2e7fd5cc316d2227ca4e4d">_imp</a> = std::move(*imp._imp);</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;        }</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;        <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    }</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="class_stl_imp.html#a37f7ccd3ed36b4a42109ee0e0f4e1c51">   29</a></span>&#160;    <a class="code" href="class_stl_imp.html#a37f7ccd3ed36b4a42109ee0e0f4e1c51">StlImp</a>(<span class="keyword">const</span> <a class="code" href="class_stl_imp.html">StlImp</a>&amp; imp) :<a class="code" href="class_stl_imp.html#a17f2d5ab8c2e7fd5cc316d2227ca4e4d">_imp</a>(new T()) {</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;        *<a class="code" href="class_stl_imp.html#a17f2d5ab8c2e7fd5cc316d2227ca4e4d">_imp</a> = *imp.<a class="code" href="class_stl_imp.html#a17f2d5ab8c2e7fd5cc316d2227ca4e4d">_imp</a>;</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    }</div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="class_stl_imp.html#a25f5d9385f2bb6be32d594c643288a86">   32</a></span>&#160;    <a class="code" href="class_stl_imp.html">StlImp</a>&amp; <a class="code" href="class_stl_imp.html#a25f5d9385f2bb6be32d594c643288a86">operator= </a>(<span class="keyword">const</span> <a class="code" href="class_stl_imp.html">StlImp</a>&amp; imp) {</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;        <span class="keywordflow">if</span> (<span class="keyword">this</span> != &amp;imp) {</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;            *<a class="code" href="class_stl_imp.html#a17f2d5ab8c2e7fd5cc316d2227ca4e4d">_imp</a> = *imp.<a class="code" href="class_stl_imp.html#a17f2d5ab8c2e7fd5cc316d2227ca4e4d">_imp</a>;</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;        }</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;        <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    }</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160; </div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="class_stl_imp.html#abb9ed43286b6b8a10e57e337e2ec65d2">   39</a></span>&#160;    T&amp; <a class="code" href="class_stl_imp.html#abb9ed43286b6b8a10e57e337e2ec65d2">GetReference</a>() {</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;        <span class="keywordflow">return</span> *<a class="code" href="class_stl_imp.html#a17f2d5ab8c2e7fd5cc316d2227ca4e4d">_imp</a>;</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    }</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160; </div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="class_stl_imp.html#a674ae769f029f3505206f3ba5a108f50">   43</a></span>&#160;    T&amp; <a class="code" href="class_stl_imp.html#a674ae769f029f3505206f3ba5a108f50">GetReference</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        <span class="keywordflow">return</span> *<a class="code" href="class_stl_imp.html#a17f2d5ab8c2e7fd5cc316d2227ca4e4d">_imp</a>;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    }</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="class_stl_imp.html#a17f2d5ab8c2e7fd5cc316d2227ca4e4d">   47</a></span>&#160;    T* <a class="code" href="class_stl_imp.html#a17f2d5ab8c2e7fd5cc316d2227ca4e4d">_imp</a>;</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;};</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<a class="code" href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclass_stl_imp_html_abb9ed43286b6b8a10e57e337e2ec65d2"><div class="ttname"><a href="class_stl_imp.html#abb9ed43286b6b8a10e57e337e2ec65d2">StlImp::GetReference</a></div><div class="ttdeci">T &amp; GetReference()</div><div class="ttdef"><b>Definition:</b> <a href="_stl_imp_8h_source.html#l00039">StlImp.h:39</a></div></div>
<div class="ttc" id="aclass_stl_imp_html"><div class="ttname"><a href="class_stl_imp.html">StlImp</a></div><div class="ttdoc">字符串接口类</div><div class="ttdef"><b>Definition:</b> <a href="_stl_imp_8h_source.html#l00012">StlImp.h:12</a></div></div>
<div class="ttc" id="atools_8h_html_a201ce692c9dca6599e5c12d00167419b"><div class="ttname"><a href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div><div class="ttdeci">#define DEF_BEG_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00036">tools.h:36</a></div></div>
<div class="ttc" id="aclass_stl_imp_html_a17f2d5ab8c2e7fd5cc316d2227ca4e4d"><div class="ttname"><a href="class_stl_imp.html#a17f2d5ab8c2e7fd5cc316d2227ca4e4d">StlImp::_imp</a></div><div class="ttdeci">T * _imp</div><div class="ttdef"><b>Definition:</b> <a href="_stl_imp_8h_source.html#l00047">StlImp.h:47</a></div></div>
<div class="ttc" id="atools_8h_html_ac909db71799bb22cb7d636a34cd785e4"><div class="ttname"><a href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div><div class="ttdeci">#define DEF_END_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00038">tools.h:38</a></div></div>
<div class="ttc" id="aclass_stl_imp_html_aa3c54c975efac41dc7b1bedb67701406"><div class="ttname"><a href="class_stl_imp.html#aa3c54c975efac41dc7b1bedb67701406">StlImp::~StlImp</a></div><div class="ttdeci">~StlImp()</div><div class="ttdef"><b>Definition:</b> <a href="_stl_imp_8h_source.html#l00016">StlImp.h:16</a></div></div>
<div class="ttc" id="aclass_stl_imp_html_a99112fb8b06920ed36adf52797c24ce8"><div class="ttname"><a href="class_stl_imp.html#a99112fb8b06920ed36adf52797c24ce8">StlImp::StlImp</a></div><div class="ttdeci">StlImp()</div><div class="ttdef"><b>Definition:</b> <a href="_stl_imp_8h_source.html#l00015">StlImp.h:15</a></div></div>
<div class="ttc" id="aclass_stl_imp_html_a674ae769f029f3505206f3ba5a108f50"><div class="ttname"><a href="class_stl_imp.html#a674ae769f029f3505206f3ba5a108f50">StlImp::GetReference</a></div><div class="ttdeci">T &amp; GetReference() const</div><div class="ttdef"><b>Definition:</b> <a href="_stl_imp_8h_source.html#l00043">StlImp.h:43</a></div></div>
<div class="ttc" id="aclass_stl_imp_html_a37f7ccd3ed36b4a42109ee0e0f4e1c51"><div class="ttname"><a href="class_stl_imp.html#a37f7ccd3ed36b4a42109ee0e0f4e1c51">StlImp::StlImp</a></div><div class="ttdeci">StlImp(const StlImp &amp;imp)</div><div class="ttdef"><b>Definition:</b> <a href="_stl_imp_8h_source.html#l00029">StlImp.h:29</a></div></div>
<div class="ttc" id="atools_8h_html_ab689500aaec0db066e3ac9483d3fe425"><div class="ttname"><a href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a></div><div class="ttdeci">#define NullPtr</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00119">tools.h:119</a></div></div>
<div class="ttc" id="aclass_stl_imp_html_a25f5d9385f2bb6be32d594c643288a86"><div class="ttname"><a href="class_stl_imp.html#a25f5d9385f2bb6be32d594c643288a86">StlImp::operator=</a></div><div class="ttdeci">StlImp &amp; operator=(const StlImp &amp;imp)</div><div class="ttdef"><b>Definition:</b> <a href="_stl_imp_8h_source.html#l00032">StlImp.h:32</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
